package com.jk.bgmainconsumer.controller;


import com.jk.bgmainconsumer.entity.OrderLogEntity;
import com.jk.bgmainconsumer.entity.UserInfoEntity;
import com.jk.bgmainconsumer.service.UserConsummerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("user")
public class UserConsummerController{

    @Resource
    private UserConsummerService userService;

    @RequestMapping("findTest")
    public String test(String name){

        return userService.test(name);
    }


    /**
     * 刘杨彬
     * 新增用户信息表
     * @param UserInfoEntity
     */
    @RequestMapping("addUserInfo")
    public void addUserInfo(UserInfoEntity UserInfoEntity){

        userService.addUserInfo(UserInfoEntity);
    }

    /**
     * 分页查询用户信息表/条件查询
     * @param UserInfoEntity
     * @return
     */
    @RequestMapping("queryUserInfo")
    public List<UserInfoEntity> queryUserInfo(UserInfoEntity UserInfoEntity){

        return userService.queryUserInfo(UserInfoEntity);
    }


    /**
     * 订单表的查询
     * @param OrderLogEntity
     * @return
     */
    @RequestMapping("queryOrderList")
    public List<OrderLogEntity>queryOrderList(OrderLogEntity OrderLogEntity){
        List<OrderLogEntity> list = userService.queryOrderList(OrderLogEntity);
        return list;
    }


    /**
     * @description:  详情回显！！
     * @param: [id]
     * @return: com.jk.bgmainconsumer.entity.UserInfoEntity
     * @author 刘杨彬
     * @date: 2021/9/2 21:04
     */
    @RequestMapping("queryOrderById")
    public OrderLogEntity queryOrderById(Integer id){

        return userService.queryOrderById(id);
    }
}
